package community.hospital.validation;

import cn.hutool.core.util.PhoneUtil;
import community.hospital.annotation.IsPhone;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * @Author：ydj
 * @Date：2023/1/16 21:08
 */
public class PhoneValidation implements ConstraintValidator<IsPhone,String> {

    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        return PhoneUtil.isPhone(value);
    }
}
